<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>

    <div>
        <p>1</p>
        <h3>22</h3>
    </div>

    <ul>
        <li>
            <h3>33</h3>
            <p>22</p>
        </li>
    </ul>

    <script>

        // getElementById 
        // getElementsByClassName
        // getElementsByTagName 

        // querySelector 
        // querySeletorAll 


        // var oH3 = document.querySelector('ul h3') ;
        // console.log(oH3) ;

        var oLi = document.querySelector('li') ;

        // 通过父元素查找子元素 --- 缩小查询范围 
        var oH3 = oLi.querySelector('h3') ;
        console.log(oH3) ;



    </script>
    
</body>
</html>